from django.conf.urls import url

from apps.users.views import UsernameCountView, MobileCountView, AddressView, ChangePasswordView, UserCenterView
from . import views

urlpatterns = [
    url(r'^register/$', views.RegisterView.as_view(), name='register'),  # 注册
    url(r'^usernames/(?P<username>[a-zA-Z0-9_]{5,20})/count/$', UsernameCountView.as_view(), name='count'),
    url(r'^mobiles/(?P<mobile>1[3-9]\d{9})/count/$', MobileCountView.as_view(), name='count_mobile'),
    url(r'^login/$', views.LoginView.as_view(), name='login'),  # 登录
    url(r'^logout/$', views.LogoutView.as_view(), name='logout'),  # 退出
    url(r'^usercenter/$', UserCenterView.as_view(), name='usercenter'),  # 用户中心
    url(r'^address/$', AddressView.as_view(), name='address'),  # 收货地址
    url(r'^password/$', ChangePasswordView.as_view(), name='password'),  # 收货地址
    url(r'^orders/info/(?P<page_num>\d+)/$', views.UserOrderInfoView.as_view(), name="my_orders"),

]
